{"ast":null,"code":"import { render } from \"rc-util/es/React/render\";\nimport * as React from 'react';\nimport ConfigProvider, { globalConfig } from '../config-provider';\nimport PurePanel from './PurePanel';\nimport useNotification, { useInternalNotification } from './useNotification';\nlet notification = null;\nlet act = callback => callback();\nlet taskQueue = [];\nlet defaultGlobalConfig = {};\nfunction getGlobalContext() {\n  const {\n    prefixCls: globalPrefixCls,\n    getContainer: globalGetContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  } = defaultGlobalConfig;\n  const mergedPrefixCls = globalPrefixCls !== null && globalPrefixCls !== void 0 ? globalPrefixCls : globalConfig().getPrefixCls('notification');\n  const mergedContainer = (globalGetContainer === null || globalGetContainer === void 0 ? void 0 : globalGetContainer()) || document.body;\n  return {\n    prefixCls: mergedPrefixCls,\n    container: mergedContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  };\n}\nconst GlobalHolder = /*#__PURE__*/React.forwardRef((_, ref) => {\n  const [prefixCls, setPrefixCls] = React.useState();\n  const [container, setContainer] = React.useState();\n  const [maxCount, setMaxCount] = React.useState();\n  const [rtl, setRTL] = React.useState();\n  const [top, setTop] = React.useState();\n  const [bottom, setBottom] = React.useState();\n  const [api, holder] = useInternalNotification({\n    prefixCls,\n    getContainer: () => container,\n    maxCount,\n    rtl,\n    top,\n    bottom\n  });\n  const global = globalConfig();\n  const rootPrefixCls = global.getRootPrefixCls();\n  const rootIconPrefixCls = global.getIconPrefixCls();\n  const sync = () => {\n    const {\n      prefixCls: nextGlobalPrefixCls,\n      container: nextGlobalContainer,\n      maxCount: nextGlobalMaxCount,\n      rtl: nextGlobalRTL,\n      top: nextTop,\n      bottom: nextBottom\n    } = getGlobalContext();\n    setPrefixCls(nextGlobalPrefixCls);\n    setContainer(nextGlobalContainer);\n    setMaxCount(nextGlobalMaxCount);\n    setRTL(nextGlobalRTL);\n    setTop(nextTop);\n    setBottom(nextBottom);\n  };\n  React.useEffect(sync, []);\n  React.useImperativeHandle(ref, () => {\n    const instance = Object.assign({}, api);\n    Object.keys(instance).forEach(method => {\n      instance[method] = function () {\n        sync();\n        return api[method].apply(api, arguments);\n      };\n    });\n    return {\n      instance,\n      sync\n    };\n  });\n  return /*#__PURE__*/React.createElement(ConfigProvider, {\n    prefixCls: rootPrefixCls,\n    iconPrefixCls: rootIconPrefixCls\n  }, holder);\n});\nfunction flushNotice() {\n  if (!notification) {\n    const holderFragment = document.createDocumentFragment();\n    const newNotification = {\n      fragment: holderFragment\n    };\n    notification = newNotification;\n    // Delay render to avoid sync issue\n    act(() => {\n      render( /*#__PURE__*/React.createElement(GlobalHolder, {\n        ref: node => {\n          const {\n            instance,\n            sync\n          } = node || {};\n          Promise.resolve().then(() => {\n            if (!newNotification.instance && instance) {\n              newNotification.instance = instance;\n              newNotification.sync = sync;\n              flushNotice();\n            }\n          });\n        }\n      }), holderFragment);\n    });\n    return;\n  }\n  // Notification not ready\n  if (!notification.instance) {\n    return;\n  }\n  // >>> Execute task\n  taskQueue.forEach(task => {\n    // eslint-disable-next-line default-case\n    switch (task.type) {\n      case 'open':\n        {\n          act(() => {\n            notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));\n          });\n          break;\n        }\n      case 'destroy':\n        act(() => {\n          notification === null || notification === void 0 ? void 0 : notification.instance.destroy(task.key);\n        });\n        break;\n    }\n  });\n  // Clean up\n  taskQueue = [];\n}\n// ==============================================================================\n// ==                                  Export                                  ==\n// ==============================================================================\nconst methods = ['success', 'info', 'warning', 'error'];\nfunction setNotificationGlobalConfig(config) {\n  defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);\n  // Trigger sync for it\n  act(() => {\n    var _a;\n    (_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);\n  });\n}\nfunction open(config) {\n  taskQueue.push({\n    type: 'open',\n    config\n  });\n  flushNotice();\n}\nfunction destroy(key) {\n  taskQueue.push({\n    type: 'destroy',\n    key\n  });\n  flushNotice();\n}\nconst baseStaticMethods = {\n  open,\n  destroy,\n  config: setNotificationGlobalConfig,\n  useNotification,\n  _InternalPanelDoNotUseOrYouWillBeFired: PurePanel\n};\nconst staticMethods = baseStaticMethods;\nmethods.forEach(type => {\n  staticMethods[type] = config => open(Object.assign(Object.assign({}, config), {\n    type\n  }));\n});\n// ==============================================================================\n// ==                                   Test                                   ==\n// ==============================================================================\nconst noop = () => {};\n/** @private Only Work in test env */\n// eslint-disable-next-line import/no-mutable-exports\nexport let actWrapper = noop;\nif (process.env.NODE_ENV === 'test') {\n  actWrapper = wrapper => {\n    act = wrapper;\n  };\n}\nexport default staticMethods;","map":{"version":3,"names":["render","React","ConfigProvider","globalConfig","PurePanel","useNotification","useInternalNotification","notification","act","callback","taskQueue","defaultGlobalConfig","getGlobalContext","prefixCls","globalPrefixCls","getContainer","globalGetContainer","rtl","maxCount","top","bottom","mergedPrefixCls","getPrefixCls","mergedContainer","document","body","container","GlobalHolder","forwardRef","_","ref","setPrefixCls","useState","setContainer","setMaxCount","setRTL","setTop","setBottom","api","holder","global","rootPrefixCls","getRootPrefixCls","rootIconPrefixCls","getIconPrefixCls","sync","nextGlobalPrefixCls","nextGlobalContainer","nextGlobalMaxCount","nextGlobalRTL","nextTop","nextBottom","useEffect","useImperativeHandle","instance","Object","assign","keys","forEach","method","apply","arguments","createElement","iconPrefixCls","flushNotice","holderFragment","createDocumentFragment","newNotification","fragment","node","Promise","resolve","then","task","type","open","config","destroy","key","methods","setNotificationGlobalConfig","_a","call","push","baseStaticMethods","_InternalPanelDoNotUseOrYouWillBeFired","staticMethods","noop","actWrapper","process","env","NODE_ENV","wrapper"],"sources":["/data/messenger.client/node_modules/antd/es/notification/index.js"],"sourcesContent":["import { render } from \"rc-util/es/React/render\";\nimport * as React from 'react';\nimport ConfigProvider, { globalConfig } from '../config-provider';\nimport PurePanel from './PurePanel';\nimport useNotification, { useInternalNotification } from './useNotification';\nlet notification = null;\nlet act = callback => callback();\nlet taskQueue = [];\nlet defaultGlobalConfig = {};\nfunction getGlobalContext() {\n  const {\n    prefixCls: globalPrefixCls,\n    getContainer: globalGetContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  } = defaultGlobalConfig;\n  const mergedPrefixCls = globalPrefixCls !== null && globalPrefixCls !== void 0 ? globalPrefixCls : globalConfig().getPrefixCls('notification');\n  const mergedContainer = (globalGetContainer === null || globalGetContainer === void 0 ? void 0 : globalGetContainer()) || document.body;\n  return {\n    prefixCls: mergedPrefixCls,\n    container: mergedContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  };\n}\nconst GlobalHolder = /*#__PURE__*/React.forwardRef((_, ref) => {\n  const [prefixCls, setPrefixCls] = React.useState();\n  const [container, setContainer] = React.useState();\n  const [maxCount, setMaxCount] = React.useState();\n  const [rtl, setRTL] = React.useState();\n  const [top, setTop] = React.useState();\n  const [bottom, setBottom] = React.useState();\n  const [api, holder] = useInternalNotification({\n    prefixCls,\n    getContainer: () => container,\n    maxCount,\n    rtl,\n    top,\n    bottom\n  });\n  const global = globalConfig();\n  const rootPrefixCls = global.getRootPrefixCls();\n  const rootIconPrefixCls = global.getIconPrefixCls();\n  const sync = () => {\n    const {\n      prefixCls: nextGlobalPrefixCls,\n      container: nextGlobalContainer,\n      maxCount: nextGlobalMaxCount,\n      rtl: nextGlobalRTL,\n      top: nextTop,\n      bottom: nextBottom\n    } = getGlobalContext();\n    setPrefixCls(nextGlobalPrefixCls);\n    setContainer(nextGlobalContainer);\n    setMaxCount(nextGlobalMaxCount);\n    setRTL(nextGlobalRTL);\n    setTop(nextTop);\n    setBottom(nextBottom);\n  };\n  React.useEffect(sync, []);\n  React.useImperativeHandle(ref, () => {\n    const instance = Object.assign({}, api);\n    Object.keys(instance).forEach(method => {\n      instance[method] = function () {\n        sync();\n        return api[method].apply(api, arguments);\n      };\n    });\n    return {\n      instance,\n      sync\n    };\n  });\n  return /*#__PURE__*/React.createElement(ConfigProvider, {\n    prefixCls: rootPrefixCls,\n    iconPrefixCls: rootIconPrefixCls\n  }, holder);\n});\nfunction flushNotice() {\n  if (!notification) {\n    const holderFragment = document.createDocumentFragment();\n    const newNotification = {\n      fragment: holderFragment\n    };\n    notification = newNotification;\n    // Delay render to avoid sync issue\n    act(() => {\n      render( /*#__PURE__*/React.createElement(GlobalHolder, {\n        ref: node => {\n          const {\n            instance,\n            sync\n          } = node || {};\n          Promise.resolve().then(() => {\n            if (!newNotification.instance && instance) {\n              newNotification.instance = instance;\n              newNotification.sync = sync;\n              flushNotice();\n            }\n          });\n        }\n      }), holderFragment);\n    });\n    return;\n  }\n  // Notification not ready\n  if (!notification.instance) {\n    return;\n  }\n  // >>> Execute task\n  taskQueue.forEach(task => {\n    // eslint-disable-next-line default-case\n    switch (task.type) {\n      case 'open':\n        {\n          act(() => {\n            notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));\n          });\n          break;\n        }\n      case 'destroy':\n        act(() => {\n          notification === null || notification === void 0 ? void 0 : notification.instance.destroy(task.key);\n        });\n        break;\n    }\n  });\n  // Clean up\n  taskQueue = [];\n}\n// ==============================================================================\n// ==                                  Export                                  ==\n// ==============================================================================\nconst methods = ['success', 'info', 'warning', 'error'];\nfunction setNotificationGlobalConfig(config) {\n  defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);\n  // Trigger sync for it\n  act(() => {\n    var _a;\n    (_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);\n  });\n}\nfunction open(config) {\n  taskQueue.push({\n    type: 'open',\n    config\n  });\n  flushNotice();\n}\nfunction destroy(key) {\n  taskQueue.push({\n    type: 'destroy',\n    key\n  });\n  flushNotice();\n}\nconst baseStaticMethods = {\n  open,\n  destroy,\n  config: setNotificationGlobalConfig,\n  useNotification,\n  _InternalPanelDoNotUseOrYouWillBeFired: PurePanel\n};\nconst staticMethods = baseStaticMethods;\nmethods.forEach(type => {\n  staticMethods[type] = config => open(Object.assign(Object.assign({}, config), {\n    type\n  }));\n});\n// ==============================================================================\n// ==                                   Test                                   ==\n// ==============================================================================\nconst noop = () => {};\n/** @private Only Work in test env */\n// eslint-disable-next-line import/no-mutable-exports\nexport let actWrapper = noop;\nif (process.env.NODE_ENV === 'test') {\n  actWrapper = wrapper => {\n    act = wrapper;\n  };\n}\nexport default staticMethods;"],"mappings":"AAAA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,cAAc,IAAIC,YAAY,QAAQ,oBAAoB;AACjE,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,eAAe,IAAIC,uBAAuB,QAAQ,mBAAmB;AAC5E,IAAIC,YAAY,GAAG,IAAI;AACvB,IAAIC,GAAG,GAAGC,QAAQ,IAAIA,QAAQ,EAAE;AAChC,IAAIC,SAAS,GAAG,EAAE;AAClB,IAAIC,mBAAmB,GAAG,CAAC,CAAC;AAC5B,SAASC,gBAAgB,GAAG;EAC1B,MAAM;IACJC,SAAS,EAAEC,eAAe;IAC1BC,YAAY,EAAEC,kBAAkB;IAChCC,GAAG;IACHC,QAAQ;IACRC,GAAG;IACHC;EACF,CAAC,GAAGT,mBAAmB;EACvB,MAAMU,eAAe,GAAGP,eAAe,KAAK,IAAI,IAAIA,eAAe,KAAK,KAAK,CAAC,GAAGA,eAAe,GAAGX,YAAY,EAAE,CAACmB,YAAY,CAAC,cAAc,CAAC;EAC9I,MAAMC,eAAe,GAAG,CAACP,kBAAkB,KAAK,IAAI,IAAIA,kBAAkB,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,kBAAkB,EAAE,KAAKQ,QAAQ,CAACC,IAAI;EACvI,OAAO;IACLZ,SAAS,EAAEQ,eAAe;IAC1BK,SAAS,EAAEH,eAAe;IAC1BN,GAAG;IACHC,QAAQ;IACRC,GAAG;IACHC;EACF,CAAC;AACH;AACA,MAAMO,YAAY,GAAG,aAAa1B,KAAK,CAAC2B,UAAU,CAAC,CAACC,CAAC,EAAEC,GAAG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